using System.Collections;
using System.Collections.Generic;
using System.Linq;
using TMPro;
using UnityEngine;
using UnityEngine.UI;

public class BattleActItemWindow : MonoBehaviour
{
	[Header("-- References --")]
	[SerializeField]
	private TextMeshProUGUI SelectedInfo_Description;

	[SerializeField]
	private TextMeshProUGUI SelectedInfo_TPCount;

	[SerializeField]
	private Transform SelectableHolder;

	[Space(5f)]
	public Transform Soul;

	public bool AllowInput;

	[SerializeField]
	private int currentSelectionIndex;

	private int previousCurrentSelectionIndex = -1;

	public BattlePartyMember targetPartyMember;

	public int targetEnemyIndex;

	[Space(5f)]
	[SerializeField]
	private GameObject Prefab_BAIWSelectable;

	[SerializeField]
	private GameObject Prefab_BAIW_CharIcon;

	[SerializeField]
	private BattleMemberSelectionMenu MemberSelectionMenu;

	[Space(10f)]
	public List<BattleActItem_StoredInformation> BAIW_CurrentSelectables;

	private void Update()
	{
		if (AllowInput && !GonerMenu.Instance.gonerMenuWasOpen && !GonerMenu.Instance.GonerMenuOpen)
		{
			InputUpdate();
		}
	}

	private void InputUpdate()
	{
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0075: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
		if (Input.GetKeyDown(PlayerInput.Instance.Key_Right))
		{
			currentSelectionIndex++;
			BattleSystem.PlayBattleSoundEffect(BattleSystem.Instance.SFX_menu_move);
		}
		if (Input.GetKeyDown(PlayerInput.Instance.Key_Left))
		{
			currentSelectionIndex--;
			BattleSystem.PlayBattleSoundEffect(BattleSystem.Instance.SFX_menu_move);
		}
		if (Input.GetKeyDown(PlayerInput.Instance.Key_Up))
		{
			currentSelectionIndex -= 2;
			BattleSystem.PlayBattleSoundEffect(BattleSystem.Instance.SFX_menu_move);
		}
		if (Input.GetKeyDown(PlayerInput.Instance.Key_Down))
		{
			currentSelectionIndex += 2;
			BattleSystem.PlayBattleSoundEffect(BattleSystem.Instance.SFX_menu_move);
		}
		if (Input.GetKeyDown(PlayerInput.Instance.Key_Cancel))
		{
			CancelSelection();
		}
		if (Input.GetKeyDown(PlayerInput.Instance.Key_Confirm))
		{
			SelectCurrentSelection();
		}
		if (currentSelectionIndex != previousCurrentSelectionIndex)
		{
			previousCurrentSelectionIndex = currentSelectionIndex;
			currentSelectionIndex = Mathf.Clamp(currentSelectionIndex, 0, BAIW_CurrentSelectables.Count - 1);
			UpdateCurrentSelection();
		}
	}

	private void CancelSelection()
	{
		if (BAIW_CurrentSelectables.Count > 0 && currentSelectionIndex > -1 && currentSelectionIndex <= BAIW_CurrentSelectables.Count)
		{
			if ((Object)(object)BAIW_CurrentSelectables[currentSelectionIndex].Selectable_Item != (Object)null)
			{
				BattleSystem.PlayBattleSoundEffect(BattleSystem.Instance.SFX_menu_move);
				BattleSystem.OpenBottomBarWindow(BattleSystem.BottomBarWindows.None);
				BattleSystem.BattleState_PlayerTurn_UpdateCurrentlySelectedStatus();
			}
			if ((Object)(object)BAIW_CurrentSelectables[currentSelectionIndex].Selectable_Action != (Object)null)
			{
				if (BattleSystem.Instance.BattlePartyMembers[BattleSystem.Instance.CurrentPlayerTurnSelectionIndex].PartyMemberInBattle.HasMagic)
				{
					BattleSystem.PlayBattleSoundEffect(BattleSystem.Instance.SFX_menu_move);
					BattleSystem.OpenBottomBarWindow(BattleSystem.BottomBarWindows.None);
					BattleSystem.BattleState_PlayerTurn_UpdateCurrentlySelectedStatus();
				}
				else
				{
					BattleSystem.PlayBattleSoundEffect(BattleSystem.Instance.SFX_menu_move);
					switch (BAIW_CurrentSelectables[currentSelectionIndex].Selectable_Action.ActionTarget)
					{
					case BattleAction.BattleActionTarget.PartyMember:
						MemberSelectionMenu.storedTargetMember = BattleSystem.Instance.BattlePartyMembers[BattleSystem.Instance.CurrentPlayerTurnSelectionIndex];
						foreach (BattlePartyMember battlePartyMember in BattleSystem.Instance.BattlePartyMembers)
						{
							MemberSelectionMenu.AddMemberName(battlePartyMember, BAIW_CurrentSelectables[currentSelectionIndex].Selectable_Item);
						}
						BattleSystem.OpenBottomBarWindow(BattleSystem.BottomBarWindows.Act_MemberSelection);
						break;
					case BattleAction.BattleActionTarget.Enemy:
						BattleSystem.OpenBottomBarWindow(BattleSystem.BottomBarWindows.Act_EnemySelection);
						break;
					}
				}
			}
		}
		AllowInput = false;
		currentSelectionIndex = 0;
		ClearAllSelectables();
		((Component)this).gameObject.SetActive(false);
	}

	private void SelectCurrentSelection()
	{
		if (BAIW_CurrentSelectables.Count <= 0 || currentSelectionIndex <= -1 || currentSelectionIndex > BAIW_CurrentSelectables.Count)
		{
			return;
		}
		if ((Object)(object)BAIW_CurrentSelectables[currentSelectionIndex].Selectable_Item != (Object)null)
		{
			if (BAIW_CurrentSelectables[currentSelectionIndex].Selectable_Item.IsSharedItem)
			{
				BattleSystem.AddNewPlayerMove(BattlePlayerMove.Item, BattleSystem.Instance.BattlePartyMembers[BattleSystem.Instance.CurrentPlayerTurnSelectionIndex], 0, null, null, BAIW_CurrentSelectables[currentSelectionIndex].Selectable_Item, DarkworldInventory.Instance.PlayerInventory.IndexOf(BAIW_CurrentSelectables[currentSelectionIndex].Selectable_Item));
				BattleSystem.Instance.PartyMembers_MemberPlayAnimation(BattleSystem.Instance.BattlePartyMembers[BattleSystem.Instance.CurrentPlayerTurnSelectionIndex], "PrepareUseItem");
				BattleSystem.IncrementCurrentPartyMemberStatusSelected();
				DarkworldInventory.Instance.PlayerInventory.Remove(BAIW_CurrentSelectables[currentSelectionIndex].Selectable_Item);
				BattleSystem.PlayBattleSoundEffect(BattleSystem.Instance.SFX_menu_select);
				BattleSystem.OpenBottomBarWindow(BattleSystem.BottomBarWindows.None);
				AllowInput = false;
				currentSelectionIndex = 0;
				previousCurrentSelectionIndex = -1;
				ClearAllSelectables();
				return;
			}
			BattleSystem.PlayBattleSoundEffect(BattleSystem.Instance.SFX_menu_select);
			MemberSelectionMenu.storedTargetMember = BattleSystem.Instance.BattlePartyMembers[BattleSystem.Instance.CurrentPlayerTurnSelectionIndex];
			foreach (BattlePartyMember battlePartyMember in BattleSystem.Instance.BattlePartyMembers)
			{
				MemberSelectionMenu.AddMemberName(battlePartyMember, BAIW_CurrentSelectables[currentSelectionIndex].Selectable_Item);
			}
			((Component)this).gameObject.SetActive(false);
			BattleSystem.OpenBottomBarWindow(BattleSystem.BottomBarWindows.Item_MemberSelection);
		}
		else
		{
			if (!((Object)(object)BAIW_CurrentSelectables[currentSelectionIndex].Selectable_Action != (Object)null))
			{
				return;
			}
			if (BAIW_CurrentSelectables[currentSelectionIndex].Selectable_Action.TPRequired > 0)
			{
				if (BAIW_CurrentSelectables[currentSelectionIndex].Selectable_Action.TPRequired <= BattleSystem.Instance.BattleSetting_TPAmount)
				{
					SetupActionMove();
				}
				else
				{
					BattleSystem.PlayBattleSoundEffect(BattleSystem.Instance.SFX_menu_deny);
				}
			}
			else
			{
				SetupActionMove();
			}
		}
	}

	private void SetupActionMove()
	{
		PartyMember[] requiredPartyMembers;
		if (BattleSystem.Instance.BattlePartyMembers[BattleSystem.Instance.CurrentPlayerTurnSelectionIndex].PartyMemberInBattle.HasMagic)
		{
			BattleSystem.PlayBattleSoundEffect(BattleSystem.Instance.SFX_menu_select);
			((Component)this).gameObject.SetActive(false);
			BattleSystem.Instance.BattleWindow_EnemySelection.GetComponent<BattleEnemySelectionMenu>().MenuContext = BattleEnemySelectionMenu.BattleEnemySelectionWindow_Context.Act;
			switch (BAIW_CurrentSelectables[currentSelectionIndex].Selectable_Action.ActionTarget)
			{
			case BattleAction.BattleActionTarget.PartyMember:
				MemberSelectionMenu.storedTargetMember = BattleSystem.Instance.BattlePartyMembers[BattleSystem.Instance.CurrentPlayerTurnSelectionIndex];
				MemberSelectionMenu.StoredBattleAction = BAIW_CurrentSelectables[currentSelectionIndex].Selectable_Action;
				foreach (BattlePartyMember battlePartyMember2 in BattleSystem.Instance.BattlePartyMembers)
				{
					MemberSelectionMenu.AddMemberName(battlePartyMember2, BAIW_CurrentSelectables[currentSelectionIndex].Selectable_Item);
				}
				BattleSystem.OpenBottomBarWindow(BattleSystem.BottomBarWindows.Act_MemberSelection);
				break;
			case BattleAction.BattleActionTarget.Enemy:
				BattleSystem.Instance.BattleWindow_EnemySelection.GetComponent<BattleEnemySelectionMenu>().StoredBattleAction = BAIW_CurrentSelectables[currentSelectionIndex].Selectable_Action;
				BattleSystem.OpenBottomBarWindow(BattleSystem.BottomBarWindows.Act_EnemySelection);
				BattleSystem.Instance.BattleWindow_EnemySelection.GetComponent<BattleEnemySelectionMenu>().UpdateGraphics();
				break;
			case BattleAction.BattleActionTarget.Nobody:
				BattleSystem.AddNewPlayerMove(BattlePlayerMove.Action, BattleSystem.Instance.BattlePartyMembers[BattleSystem.Instance.CurrentPlayerTurnSelectionIndex], 0, null, BAIW_CurrentSelectables[currentSelectionIndex].Selectable_Action);
				BattleSystem.Instance.PartyMembers_MemberPlayAnimation(BattleSystem.Instance.BattlePartyMembers[BattleSystem.Instance.CurrentPlayerTurnSelectionIndex], BAIW_CurrentSelectables[currentSelectionIndex].Selectable_Action.AnimationToAction);
				((Component)this).gameObject.SetActive(false);
				BattleSystem.OpenBottomBarWindow(BattleSystem.BottomBarWindows.None);
				BattleSystem.IncrementCurrentPartyMemberStatusSelected();
				currentSelectionIndex = 0;
				break;
			}
			BattleSystem.Instance.PartyMembers_MemberPlayAnimation(BattleSystem.Instance.BattlePartyMembers[BattleSystem.Instance.CurrentPlayerTurnSelectionIndex], BAIW_CurrentSelectables[currentSelectionIndex].Selectable_Action.AnimationToAction);
			requiredPartyMembers = BAIW_CurrentSelectables[currentSelectionIndex].Selectable_Action.RequiredPartyMembers;
			foreach (PartyMember target in requiredPartyMembers)
			{
				BattlePartyMember battlePartyMember = BattleSystem.Instance.BattlePartyMembers.FirstOrDefault((BattlePartyMember member) => (Object)(object)member.PartyMemberInBattle == (Object)(object)target);
				if (battlePartyMember != null)
				{
					BattleSystem.Instance.PartyMembers_MemberPlayAnimation(battlePartyMember, BAIW_CurrentSelectables[currentSelectionIndex].Selectable_Action.AnimationToAction);
				}
			}
			currentSelectionIndex = 0;
			return;
		}
		if (BAIW_CurrentSelectables[currentSelectionIndex].Selectable_Action.RequiredPartyMembers.Length != 0)
		{
			bool flag = true;
			requiredPartyMembers = BAIW_CurrentSelectables[currentSelectionIndex].Selectable_Action.RequiredPartyMembers;
			for (int i = 0; i < requiredPartyMembers.Length; i++)
			{
				BattlePartyMember partyMember = BattleSystem.GetPartyMember(requiredPartyMembers[i]);
				if (partyMember != null && partyMember.PartyMember_Health <= 0f)
				{
					flag = false;
				}
			}
			if (flag)
			{
				BattleSystem.PlayBattleSoundEffect(BattleSystem.Instance.SFX_menu_select);
				BattleSystem.AddNewPlayerMove(BattlePlayerMove.Action, BattleSystem.Instance.BattlePartyMembers[BattleSystem.Instance.CurrentPlayerTurnSelectionIndex], targetEnemyIndex, null, BAIW_CurrentSelectables[currentSelectionIndex].Selectable_Action);
				BattleSystem.Instance.PartyMembers_MemberPlayAnimation(BattleSystem.Instance.BattlePartyMembers[BattleSystem.Instance.CurrentPlayerTurnSelectionIndex], BAIW_CurrentSelectables[currentSelectionIndex].Selectable_Action.AnimationToAction);
				requiredPartyMembers = BAIW_CurrentSelectables[currentSelectionIndex].Selectable_Action.RequiredPartyMembers;
				for (int i = 0; i < requiredPartyMembers.Length; i++)
				{
					BattlePartyMember partyMember2 = BattleSystem.GetPartyMember(requiredPartyMembers[i]);
					if (partyMember2 != null)
					{
						BattleSystem.Instance.PartyMembers_MemberPlayAnimation(partyMember2, BAIW_CurrentSelectables[currentSelectionIndex].Selectable_Action.AnimationToAction);
						partyMember2.SkippingTurn = true;
					}
				}
				((Component)this).gameObject.SetActive(false);
				BattleSystem.OpenBottomBarWindow(BattleSystem.BottomBarWindows.None);
				BattleSystem.IncrementCurrentPartyMemberStatusSelected();
				currentSelectionIndex = 0;
			}
			else
			{
				BattleSystem.PlayBattleSoundEffect(BattleSystem.Instance.SFX_menu_deny);
			}
			return;
		}
		BattleSystem.PlayBattleSoundEffect(BattleSystem.Instance.SFX_menu_select);
		BattleSystem.AddNewPlayerMove(BattlePlayerMove.Action, BattleSystem.Instance.BattlePartyMembers[BattleSystem.Instance.CurrentPlayerTurnSelectionIndex], targetEnemyIndex, null, BAIW_CurrentSelectables[currentSelectionIndex].Selectable_Action);
		BattleSystem.Instance.PartyMembers_MemberPlayAnimation(BattleSystem.Instance.BattlePartyMembers[BattleSystem.Instance.CurrentPlayerTurnSelectionIndex], BAIW_CurrentSelectables[currentSelectionIndex].Selectable_Action.AnimationToAction);
		requiredPartyMembers = BAIW_CurrentSelectables[currentSelectionIndex].Selectable_Action.RequiredPartyMembers;
		for (int i = 0; i < requiredPartyMembers.Length; i++)
		{
			BattlePartyMember partyMember3 = BattleSystem.GetPartyMember(requiredPartyMembers[i]);
			if (partyMember3 != null)
			{
				BattleSystem.Instance.PartyMembers_MemberPlayAnimation(partyMember3, BAIW_CurrentSelectables[currentSelectionIndex].Selectable_Action.AnimationToAction);
				partyMember3.SkippingTurn = true;
			}
		}
		((Component)this).gameObject.SetActive(false);
		BattleSystem.OpenBottomBarWindow(BattleSystem.BottomBarWindows.None);
		BattleSystem.IncrementCurrentPartyMemberStatusSelected();
		currentSelectionIndex = 0;
	}

	public void FinishWindowStuff()
	{
		BattleSystem.Instance.PartyMembers_MemberPlayAnimation(BattleSystem.Instance.BattlePartyMembers[BattleSystem.Instance.CurrentPlayerTurnSelectionIndex], BAIW_CurrentSelectables[currentSelectionIndex].Selectable_Action.AnimationToAction);
		BattleSystem.IncrementCurrentPartyMemberStatusSelected();
		DarkworldInventory.Instance.PlayerInventory.Remove(BAIW_CurrentSelectables[currentSelectionIndex].Selectable_Item);
		AllowInput = false;
		currentSelectionIndex = 0;
		previousCurrentSelectionIndex = -1;
		ClearAllSelectables();
	}

	public void ResetBattleActItemWindow()
	{
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		currentSelectionIndex = 0;
		Soul.localPosition = new Vector3(-597.75f, 66.5f, 0f);
	}

	public void UpdateCurrentSelection()
	{
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_006f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0114: Unknown result type (might be due to invalid IL or missing references)
		//IL_0119: Unknown result type (might be due to invalid IL or missing references)
		//IL_0128: Unknown result type (might be due to invalid IL or missing references)
		//IL_012d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0132: Unknown result type (might be due to invalid IL or missing references)
		//IL_0133: Unknown result type (might be due to invalid IL or missing references)
		//IL_013e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0155: Unknown result type (might be due to invalid IL or missing references)
		//IL_0156: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
		foreach (BattleActItem_StoredInformation bAIW_CurrentSelectable in BAIW_CurrentSelectables)
		{
			((Graphic)bAIW_CurrentSelectable.Selectable_References.Selectable_NameText).color = bAIW_CurrentSelectable.Selectable_References.UnselectedColor;
			if ((Object)(object)bAIW_CurrentSelectable.Selectable_Action != (Object)null && bAIW_CurrentSelectable.Selectable_Action.TPRequired > 0 && bAIW_CurrentSelectable.Selectable_Action.TPRequired > BattleSystem.Instance.BattleSetting_TPAmount)
			{
				((Graphic)bAIW_CurrentSelectable.Selectable_References.Selectable_NameText).color = Color.grey;
			}
		}
		if (currentSelectionIndex > BAIW_CurrentSelectables.Count || currentSelectionIndex < 0)
		{
			return;
		}
		BattleActItem_StoredInformation battleActItem_StoredInformation = BAIW_CurrentSelectables[currentSelectionIndex];
		if ((Object)(object)battleActItem_StoredInformation.Selectable_Action != (Object)null && battleActItem_StoredInformation.Selectable_Action.TPRequired > 0 && battleActItem_StoredInformation.Selectable_Action.TPRequired > BattleSystem.Instance.BattleSetting_TPAmount)
		{
			((Graphic)battleActItem_StoredInformation.Selectable_References.Selectable_NameText).color = Color.grey;
		}
		Vector2 val = Vector2.op_Implicit(((Component)battleActItem_StoredInformation.Selectable_References).transform.position) + new Vector2(-175f, -5f);
		if (val != new Vector2(-815f, -120f))
		{
			((Component)Soul).transform.position = Vector2.op_Implicit(val);
		}
		if ((Object)(object)battleActItem_StoredInformation.Selectable_Item != (Object)null)
		{
			((TMP_Text)SelectedInfo_Description).text = battleActItem_StoredInformation.Selectable_Item.BattleInfo;
			((TMP_Text)SelectedInfo_TPCount).text = "";
		}
		if ((Object)(object)battleActItem_StoredInformation.Selectable_Action != (Object)null)
		{
			((TMP_Text)SelectedInfo_Description).text = battleActItem_StoredInformation.Selectable_Action.ActionDescription;
			if (battleActItem_StoredInformation.Selectable_Action.TPRequired != 0)
			{
				((TMP_Text)SelectedInfo_TPCount).text = battleActItem_StoredInformation.Selectable_Action.TPRequired + "% TP";
			}
			else
			{
				((TMP_Text)SelectedInfo_TPCount).text = "";
			}
		}
	}

	public void AddMemberMagicActions()
	{
		BattlePartyMember battlePartyMember = BattleSystem.Instance.BattlePartyMembers[BattleSystem.Instance.CurrentPlayerTurnSelectionIndex];
		if ((Object)(object)battlePartyMember.PartyMemberAction != (Object)null)
		{
			AddNewSelectable(null, battlePartyMember.PartyMemberAction, IsMagicAction: true, battlePartyMember.PartyMemberInBattle);
		}
	}

	public void AddNewSelectable(InventoryItem item = null, BattleAction act = null, bool IsMagicAction = false, PartyMember target = null)
	{
		//IL_0097: Unknown result type (might be due to invalid IL or missing references)
		//IL_00df: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
		if (!((Object)(object)act != (Object)null) && !((Object)(object)item != (Object)null))
		{
			return;
		}
		GameObject val = Object.Instantiate<GameObject>(Prefab_BAIWSelectable, SelectableHolder);
		BattleActItem_StoredInformation battleActItem_StoredInformation = new BattleActItem_StoredInformation();
		battleActItem_StoredInformation.Selectable_References = val.GetComponent<BattleActItemSelectable>();
		if ((Object)(object)item != (Object)null)
		{
			battleActItem_StoredInformation.Selectable_Item = item;
			battleActItem_StoredInformation.Selectable_References.SetSelectableName(item.ItemName);
		}
		if ((Object)(object)act != (Object)null)
		{
			battleActItem_StoredInformation.Selectable_Action = act;
			battleActItem_StoredInformation.Selectable_References.SetSelectableName(act.ActionName);
			if (IsMagicAction && Object.op_Implicit((Object)(object)target))
			{
				((Graphic)battleActItem_StoredInformation.Selectable_References.Selectable_NameText).color = target.PartyMemberColor_Highlighted;
				((TMP_Text)battleActItem_StoredInformation.Selectable_References.Selectable_NameText).text = ((Object)target).name.ToUpper().ToCharArray()[0] + "-行动";
				battleActItem_StoredInformation.Selectable_References.UnselectedColor = target.PartyMemberColor_Highlighted;
			}
			PartyMember[] requiredPartyMembers = act.RequiredPartyMembers;
			foreach (PartyMember partyMember in requiredPartyMembers)
			{
				battleActItem_StoredInformation.Selectable_References.AddCharacterIcon(partyMember);
			}
		}
		BAIW_CurrentSelectables.Add(battleActItem_StoredInformation);
	}

	public void ClearAllSelectables()
	{
		foreach (BattleActItem_StoredInformation bAIW_CurrentSelectable in BAIW_CurrentSelectables)
		{
			if ((Object)(object)bAIW_CurrentSelectable.Selectable_References != (Object)null)
			{
				Object.Destroy((Object)(object)((Component)bAIW_CurrentSelectable.Selectable_References).gameObject);
			}
		}
		((TMP_Text)SelectedInfo_Description).text = "";
		((TMP_Text)SelectedInfo_TPCount).text = "";
		BAIW_CurrentSelectables.Clear();
	}

	public void AddDarkworldInventoryToSelectables()
	{
		ClearAllSelectables();
		foreach (InventoryItem item in DarkworldInventory.Instance.PlayerInventory)
		{
			if (item.Useable)
			{
				AddNewSelectable(item);
			}
		}
	}

	public void AddActionsToSelectables(List<BattleAction> actions)
	{
		ClearAllSelectables();
		AddMemberMagicActions();
		foreach (BattleAction action in actions)
		{
			if ((Object)(object)action.TargetPartyMember != (Object)null)
			{
				if ((Object)(object)action.TargetPartyMember == (Object)(object)BattleSystem.Instance.BattlePartyMembers[BattleSystem.Instance.CurrentPlayerTurnSelectionIndex].PartyMemberInBattle)
				{
					MonoBehaviour.print((object)((Object)action).name);
					AddNewSelectable(null, action);
				}
			}
			else
			{
				MonoBehaviour.print((object)((Object)action).name);
				AddNewSelectable(null, action);
			}
		}
	}

	public void Debounce_AllowInput()
	{
		((MonoBehaviour)this).StartCoroutine(allowInputDelay());
	}

	private IEnumerator allowInputDelay()
	{
		yield return null;
		AllowInput = true;
		UpdateCurrentSelection();
	}
}
